<?php
('Access-Control-Allow-Origin：*');
include("../config/mysql.php");
$db = new mysql();
$company = $_POST["company"];
$username = $_POST["username"];
$userpwd = $_POST["userpwd"];
$tname = $_POST["tname"];
$sql = "INSERT INTO company (companyName) VALUES ('{$company}')";
$id = $db->QueryReturnId($sql);
$sql = "INSERT INTO teachers (username,userpwd,tname,company_id,scale) VALUES ('{$username}','{$userpwd}','{$tname}','{$id}',1)";
echo $db->Query($sql);
$db->close();
